<html>
<head>
<title>Kismet</title>

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<script src="/js/msgpack.js"></script>

<script src="/js/jquery-3.1.0.min.js"></script>
<script src="/js/jquery-ui.min.js"></script>
<script src="/js/jquery.ui.touch-punch.min.js"></script>
<script src="/js/jquery.ajax.binary.js"></script>
<script src="/js/jquery.jspanel-compiled.min.js"></script>
<script src="/js/simple-expand.min.js"></script>
<script src="/js/jqueryui-editable.min.js"></script>

<script src="/js/jquery.dataTables.min.js"></script>
<script src="/js/dataTables.scroller.min.js"></script>
<script src="/js/dataTables.scrollResize.js"></script>
<script src="/js/dataTables.pageResize.js"></script>
<script src="/js/dataTables.colReorder.min.js"></script>
<script src="/js/dataTables.responsive.min.js"></script>

<script src="/js/jquery.sparkline.min.js"></script>

<script src="/js/raphael.min.js"></script>
<script src="/js/morris.min.js"></script>

<script src="/js/jquery.layout-latest.js"></script>

<script src="/js/pushmenu.js"></script>

<script src="/js/Chart.bundle.min.js"></script>

<script src="/js/js.storage.min.js"></script>

<script src="/js/tooltipster.bundle.min.js"></script>

<script src="/js/kismet.utils.js"></script>

<!-- Core UI elements that get loaded first -->
<script src="/js/kismet.ui.sidebar.js"></script>
<script src="/js/kismet.ui.tabpane.js"></script>
<script src="/js/kismet.ui.settings.js"></script>

<script src="/js/kismet.ui.js"></script>

<script src="/js/kismet.ui.base.js"></script>
<script src="/js/kismet.ui.gadgets.js"></script>

<script src="/js/jquery.kismet.devicedata.js"></script>
<script src="/js/jquery.kismet.messagebus.js"></script>
<script src="/js/jquery.kismet.channeldisplay.js"></script>

<script src="/js/kismet.ui.iconbar.js"></script>
<script src="/js/jquery.kismet.battery.js"></script>
<script src="/js/jquery.kismet.alert.js"></script>
<script src="/js/jquery.kismet.auth.js"></script>
<script src="/js/jquery.kismet.gps.js"></script>

<link rel="stylesheet" type="text/css" href="/css/font-awesome.min.css">

<link rel="stylesheet" type="text/css" href="/css/jquery-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/css/jquery.jspanel.min.css" />
<link rel="stylesheet" type="text/css" href="/css/jquery.dataTables.min.css" />
<link rel="stylesheet" type="text/css" href="/css/responsive.dataTables.min.css" />
<link rel="stylesheet" type="text/css" href="/css/colReorder.dataTables.min.css" />
<link rel="stylesheet" type="text/css" href="/css/morris.css" />

<link rel="stylesheet" type="text/css" href="/css/layout-default-1.4.0.css" />

<link rel="stylesheet" type="text/css" href="/css/pushmenu.css" />

<link rel="stylesheet" type="text/css" href="/css/tooltipster.bundle.min.css" />

<link rel="stylesheet" type="text/css" href="/css/jqueryui-editable.css" />

<link rel="stylesheet" type="text/css" href="/css/jquery.kismet.messagebus.css" />
<link rel="stylesheet" type="text/css" href="/css/jquery.kismet.channeldisplay.css" />
<link rel="stylesheet" type="text/css" href="/css/jquery.kismet.alert.css" />
<link rel="stylesheet" type="text/css" href="/css/jquery.kismet.battery.css" />
<link rel="stylesheet" type="text/css" href="/css/jquery.kismet.auth.css" />
<link rel="stylesheet" type="text/css" href="/css/jquery.kismet.gps.css" />

<link rel="stylesheet" type="text/css" href="/css/reset.css" />
<link rel="stylesheet" type="text/css" href="/css/text.css" />
<link rel="stylesheet" type="text/css" href="/css/layout.css" />

<link rel="stylesheet" type="text/css" href="/css/kismet.css" />

<style type="text/css">
/* Fix the hover-highlight of the device table */
td.highlight {
    background-color: #dddddd !important;
}

/* Accordion scroll */
div.autosize {
    min-height: 10px;
    overflow: scroll;
}

</style>

<script>

// jquery onload complete
$(function() {
    // Set a global timeout
    $.ajaxSetup({
        timeout:5000,
        xhrFields: {
            withCredentials: true
        }
    });

    // Don't let DT make alerts
    $.fn.dataTableExt.sErrMode = "console";

    $('#pm_menu').pushmenu({ button : "#pm_open" });

    // Compute 30% height of window
    var southsize = $(window).height() * 0.30;

    // Load the framework
    var layout = $('#panelcontainer').layout({
        resizeWithWindowDelay:  250,
        north: {
            closable: false,
            resizeable: false,
            slidable: false,
            togglerLength_open: 0,
            togglerLength_closed: -1,
            fxName: "none",
            spacing_open: 1,
        },
        center: {
            onresize: function() {
                // kismet_ui.ResizeDeviceTable($('#devices'));
            },
        },
        south: {
            // Default to computed percentage of total window
            size: southsize,
            onresize: function() {
                $('#southpane-tabs').tabs("refresh");
            },
        },
    });

    // Dynamic load of our plugin js, then continue.  is this the only way to do
    // this?  sure is annoying.
    kismet.LoadDynamicIncludes(function() {

    kismet_ui.CreateDeviceTable($('#devices'));

    kismet_ui_iconbar.AddIconbarItem({
        id: 'login',
        priority: 100,
        createCallback: function(div) {
            div.loginwatcher();
        }
    });

    kismet_ui_iconbar.AddIconbarItem({
        id: 'gps',
        priorty: 110,
        createCallback: function(div) {
            div.gps();
        }
    })

    kismet_ui_iconbar.AddIconbarItem({
        id: 'alert',
        priority: 125,
        createCallback: function(div) {
            div.alert();
        },
    });

    kismet_ui_iconbar.AddIconbarItem({
        id: 'battery',
        priority: 150,
        createCallback: function(div) {
            div.battery();
        }
    });

    kismet_ui_iconbar.makeIconbar($('#iconbar'));

    /*
    $('#topbar_alert').alert();
    $('#topbar_login').loginwatcher();
    $('#topbar_battery').battery();
    */

    kismet_ui.HealthCheck();

    // Finalize the sidebar
    kismet_ui_sidebar.MakeSidebar($('.k-sb-main'));

    // finalize the tabs
    kismet_ui_tabpane.MakeTabPane($('#southpane-tabs'));

    // Show the welcome
    var welcome = kismet_ui_base.FirstTimeCheck();

    // Check the login
    if (welcome == false) {
        kismet_ui_base.FirstLoginCheck();
    }

}); // when

}); // onload
</script>

</head>
<body>
    <div id="mainholder">
        <div id="pm_menu" class="pm_hide pm_initial kismet_sidebar">
            <div class="k-sb-header">
                <h1>Kismet</h1>
                <hr>
            </div>
            <div class="k-sb-main">
            </div>
        </div>

        <div id="panelcontainer">

            <div class="ui-layout-north">
                <div id="topbar">
                    <i id="pm_open" class="fa fa-bars k-sb-hamburger"></i>
                    <div id="topbar_title">Kismet</div>
                    <div class="topright_holder" id="iconbar"></div>
                </div>
            </div>

            <!--
                <div class="ui-layout-east">East</div>

                <div class="ui-layout-west">West</div>
            -->

            <div class="ui-layout-center" id="main_center">
                <table id="devices" class="stripe hover" cell-spacing="0" width="100%"></table>
            </div>

            <div class="ui-layout-south">
                <div id="southpane-tabs" class="tabs-min"></div>
            </div>

        </div>

        <div id="creditbar">
            <p>Powered by many OSS components, see the <a href="/credit.html" target="_new">credits page</a>
        </div>
    </div>

</body>
</html>
